package UILayer;

import java.util.Scanner;
import CtrlLayer.*;
import ModelLayer.*;
/**
 * Write a description of class EmployeeUI here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class EmployeeUI
{
    private RegisteredCustomerUI registeredUI;
    private UnregisteredCustomerUI unregisteredUI;

    public EmployeeUI()
    {
        registeredUI = new RegisteredCustomerUI();
        unregisteredUI = new UnregisteredCustomerUI();
    }

    public void employeeMenuStart()
    {
        boolean exit=false;
        while (!exit) //! means while exit not is true (that is: false)
        {
            int choise = writeEmployeeMenu();

            switch (choise) 
            {
                case 1: registeredUI.registeredCustomerMenuStart();
                break;
                case 2: unregisteredUI.unregisteredCustomerMenuStart();
                break;
                case 3: exit = true;
                break;
            }
        }//end while
    }//end start

    private int writeEmployeeMenu()
    {  
        int choise = 0;
        try
        {
            // creates a keyboard object to read input
            Scanner keyboard = new Scanner(System.in);
            System.out.println("\f *** Employee Menu ***");
            System.out.println(" (1) Service a registered customer");
            System.out.println(" (2) Service an unregistered customer");
            System.out.println(" (3) Back");

            choise = keyboard.nextInt();
        }
        catch(Exception e)
        {
            System.out.println("ERROR!");
            employeeMenuStart();
        }
        return choise;
    }

    private void pause()
    {
        Scanner keyboard = new Scanner(System.in);
        String vent = keyboard.nextLine();
    }
}
